Add an imap for Feynman slash notation#1611
Add an imap for Feynman slash notation#1611rsekman wants to merge 2 commits intolervag:masterfrom rsekman:master
Conversation
`/p -> \slashed{p}
We need to add a flag to g:vimtex_imaps_list entries that tell vimtex not to call string() on the rhs to make this possible.
| endif | ||
| let b:vimtex_context[l:key] = a:map.context | ||
| endif | ||
| if ! get(a:map, 'expr', 0) |
There was a problem hiding this comment.
I prefer:
if !get(a:map, 'expr') The 0 is default and the space after ! is unnecessary, IMHO.
|
I like this idea. It is simple and provide some extra utility. However, I'm curious, is it possible to make it slightly more "general"? If not, then I'd prefer to keep the Feynman specific stuff out and instead only add the part that allows the functionality. This allows you to add the Feynman map in your own custom configuration without too much inconvenience. Note: The tests do not pass. So there is something that is not quite right yet. |
|
The tests fail due to a minor error on my part. I'll push a fix for it now, please rebase your work on top of new master (i.e. with |
I agree, there are several similar applications, like, The general pattern is |
|
Closing in favor of #1612 which is more general. |
|
Great, thanks. |
One can also imagine similar mappings like
`_v -> \mathbf{v}.